﻿<!--
Copyright © 2013 ForQuilt.CodePlex.com
All rights reserved.       
-->
<UserControl x:Class="ForQuilt.App.Views.Controls.RotationControlView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
             xmlns:r="clr-namespace:ForQuilt.App.Helpers.Localization"
             mc:Ignorable="d" >
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="35"></ColumnDefinition>
            <ColumnDefinition Width="23"></ColumnDefinition>
            <ColumnDefinition Width="23"></ColumnDefinition>
            <ColumnDefinition Width="23"></ColumnDefinition>
            <ColumnDefinition Width="23"></ColumnDefinition>
            <ColumnDefinition Width="23"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="20"></RowDefinition>
            <RowDefinition Height="20"></RowDefinition>
        </Grid.RowDefinitions>
        <Label Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" Content="{Binding RotationAngle}" ContentStringFormat="{}{0:F0}" VerticalAlignment="Center" HorizontalAlignment="Center" 
               ToolTip="{r:Res Name=ToolTip_Rotation_angle}" />
        <Button Grid.Column="1" Grid.Row="0" Command="{Binding RotateRight45}" Margin="1,1,1,1" ToolTip="{r:Res Name=ToolTip_Rotate_right_on_45_degree}">
            <Image Source="/Properties\Images/RotateRight45degIcon.png" />
        </Button>
        <Button Grid.Column="2" Grid.Row="0" Command="{Binding RotateRight1}" Margin="1,1,1,1" ToolTip="{r:Res Name=ToolTip_Rotate_right_on_1_degree}" >
            <Image Source="/Properties\Images/RotateRight1degIcon.png" />
        </Button>
        <Button Grid.Column="3" Grid.Row="0" Command="{Binding ResetRotation}" Margin="1,1,1,1" ToolTip="{r:Res Name=ToolTip_Reset_rotation}"  >
            <Image Source="/Properties\Images/ResetRotationIcon.png" />
        </Button>
        <Button Grid.Column="4" Grid.Row="0" Command="{Binding RotateLeft1}" Margin="1,1,1,1" ToolTip="{r:Res Name=ToolTip_Rotate_left_on_1_degree}">
            <Image Source="/Properties\Images/RotateLeft1degIcon.png" />
        </Button>
        <Button Grid.Column="5" Grid.Row="0" Command="{Binding RotateLeft45}" Margin="1,1,1,1" ToolTip="{r:Res Name=ToolTip_Rotate_left_on_45_degree}">
            <Image Source="/Properties\Images/RotateLeft45degIcon.png" />
        </Button>
        <Slider HorizontalAlignment="Stretch" Grid.Column="1" Grid.ColumnSpan="5" Grid.Row="1" Orientation="Horizontal" ValueChanged="RangeBase_OnValueChanged" Value="{Binding RotationAngle}" 
                VerticalAlignment="Center" Height="20" Minimum="-180" Maximum="180" ToolTip="{r:Res Name=ToolTip_Rotate}"/>
    </Grid>
</UserControl>
